/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.model.domain.proceso.envio.carga;

import com.model.domain.persona.HogarXml;
import com.model.domain.proceso.envio.subida.xml.RegistroXmlHogar;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 *
 * @author Rdelacruz
 */
public class ConjuntoControlesEnvioHogar {
    private final Map<String,ControlEnvioHogar> mapControlesEnvioHogar = new HashMap<String,ControlEnvioHogar>(); 
    private final List<ControlEnvioHogar> reglasControlEnvioHogar = new ArrayList<ControlEnvioHogar>();
    
    public ControlEnvioHogar getControlHogarPara(RegistroXmlHogar regXml) {
        return mapControlesEnvioHogar.get(regXml.getKeyHogar());
    }
    
    public void addControlEnvioHogar(ControlEnvioHogar control) throws Exception {     
        HogarXml hogarXml = control.getReglaEnvioHogar().getHogarXml();
        mapControlesEnvioHogar.put(hogarXml.getKeyHogar(), control);
        reglasControlEnvioHogar.add(control);
    }
    
    public List<ControlEnvioHogar> getControlesEnvioHogar() {
        return reglasControlEnvioHogar;
    }    
    
}
